home *** CD-ROM | disk | FTP | other *** search
- Path: coranto.ucs.mun.ca!usenet
- From: saustin@terra.nlnet.nf.ca (Steve Austin)
- Newsgroups: comp.lang.c++
- Subject: Re: mixing static and const qualifiers for class members
- Date: Sat, 23 Mar 1996 14:49:59 GMT
- Organization: Kickham Productions
- Message-ID: <4j1327$235@coranto.ucs.mun.ca>
- References: <1996Mar20.143749.90333@ucl.ac.uk>
- NNTP-Posting-Host: n104h131.nlnet.nf.ca
- X-Newsreader: Forte Agent .99b.112
-
- ucecb09@ucl.ac.uk (Robert Byrne) wrote:
-
- >The simple way to declare integral class constants is with an enumeration.
- >
- >class Foo{
- > enum constants{nPositions = 6};
- > public:
- > int nData[nPositions];
- >};
-
- I know some compilers ( eg Borland ) allow this, but is this portable?
- I've always cast to int in this situation:
-
- nt nData[int(nPositions)];
-
- Mind you, I've never checked on this. Am I wasting my time?
-
- - Steve
-
-